package com.own.center;

import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.own.core.html.form.object.ObjectField;
import com.own.core.html.form.textField.TextField;
import com.own.core.object.Dao;

@Entity
@Table(name = "cm_major")
public class Major extends Dao {
	private long id;

	@TextField(required = true,linkable="sessions")
	private String name;
	
	
//	@ObjectField
	private Set<Session> sessions;

	@Id
	@GeneratedValue(strategy = GenerationType.TABLE)
	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@OneToMany(mappedBy = "major")
	public Set<Session> getSessions() {
		return sessions;
	}

	public void setSessions(Set<Session> sessions) {
		this.sessions = sessions;
	}

}
